<html>
    <head>
        
        <link rel="stylesheet" href="/css/home/home.css" />
        <link rel="stylesheet" href="/css/home/message.css" />
        <script type="text/javascript">
//            $(function() {
//                $(".btnNewMessage" ).button();
//            });
            $(document).ready(function(){
                $(".message-date").prettyDate();
                setInterval(function(){ $(".message-date").prettyDate(); }, 60000);
            })
        </script>
    </head>
    <body>
        <div class="ui-widget-content ui-corner-all" style="padding: 20px 10px; margin: 40px 0">
            <div class="title-head">Messages</div>
            <table id="" cellpadding="0" cellspacing="0" class="mainLayout">
                <tr>
                    <td align="left" class="mainLeftCol">
                        <table cellpadding="0" cellspacing="0" width="100%">
                            
<!--                            <tr  style="height: 5px">
                                <td valign="middle" class="paddingBottom10" style="padding-left: 40px;">
                                    <div style="width: 100%;" class="uiHeaderPage">
                                        <div class="clearfix">
                                            <div class="btnNewMessage floatRight">
                                                <a href="javascript: void(0);" class="btn" onclick="ShowPopUp('#dialog');" style="height: 20px; font-size: 12px;">New Message </a>
                                            </div>
                                        </div>
                                    </div>
                                </td>
                            </tr>-->
                            <tr>
                                <td>
                                    <table cellpadding="4" cellspacing="4" width="100%" style="font-size: 12px" >
                                        <tr>
                                            <td colspan="2">
                                                <span style="font-size: 16px; font-weight: normal;">Conversation between <span style="color: #3679AB">you</span> and <span style="color: #3679AB"><?php echo $messagePeer->getFullname(); ?></span></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2" style="border-bottom: 1px solid #BBBBBB;">
                                                <span style="font-size: 20px; font-weight: normal;">
                                                    <?php echo $message->getSubject(); ?>
                                                </span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td rowspan="2" width="50px" valign="top">
                                                <img src="<?php echo url_for('entityImage/index?entityid='.$messageSender->getId().'?>') ?>" width="50px" alt="<?php echo $messageSender->getFirstname().' '.$messageSender->getLastname() ?>"/>
                                            </td>
                                            <td id="txtMessageSender" align="left">
                                                <a class="" style="font-weight: bold; color: #3679AB"><?php echo $messageSender->getFullname(); ?></a>
                                                &nbsp; <span class="message-date" title="<?php echo $message->getCreated_at() ?>"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <div id="dvMessageBody" class="" style="overflow: auto; width: 100%; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #eeecec;"><?php echo $message->getBody(); ?></div>
                                            </td>
                                        </tr>
                                        <?php foreach($message->getMessagereply() as $messageReply): ?>
                                        <tr>
                                            <td rowspan="2" width="50px" valign="top">
                                                <img src="<?php echo url_for('entityImage/index?entityid='.$messageReply->getFromEntityId().'?>') ?>" width="50px" alt="<?php echo $messageSender->getFirstname().' '.$messageSender->getLastname() ?>"/>
                                            </td>
                                            <td align="left">
                                                <a class="paddingBottom10" style="font-weight: bold; color: #3679AB"><?php echo Entity::GetEntity($messageReply->getFromEntityId())->getFullname(); ?></a>
                                                &nbsp; <span class="message-date" title="<?php echo $messageReply->getCreated_at() ?>"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <div class="" style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #eeecec;">
                                                    <?php echo htmlspecialchars_decode($messageReply->getReplybody()); ?>
                                                </div>
                                            </td>
                                        </tr>
                                        <?php endforeach; ?>
                                        <form id="frmSendMessageReply" name="frmSendMessageReply" action="<?php echo url_for('home/sendMessageReply?mid='.$message->getId()) ?>">
                                            <tr>
                                                <td>&nbsp;</td>
                                                <td id="" align="left" >
                                                    <textarea cols="20" id="txtMsgReply" name="Reply" rows="5" style="width: 98.5%" class="ui-widget"></textarea>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>&nbsp;</td>
                                                <td id="" align="right" >
                                                    <button id="btnReply" onclick="document.frmSendMessageReply.submit()" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
                                                        <span class="ui-button-text">Reply</span>
                                                    </button>
                                                </td>
                                            </tr>
                                        </form>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
    </body>
</html>
<!--<link rel="stylesheet" href="/css/demos.css">-->
<!--<link rel="stylesheet" href="/css/themes/ui-lightness/jquery.ui.all.css">-->

<!--<link rel="stylesheet" type="text/css" href="/css/Module_Home/new.css" />-->



<!--<div id="bodier">
    <div id="right">
        <div id="right-wrapper">
            <div id="boxes">
                <div id="dialog" class="window" style="widows: 350px; height: 300px;">
                    <div  class="windowheading">
                        <a href="#"class="close"><img src="/images/close.png" width="18" height="18" alt="mails"/></a>
                    </div>
                    <div id="adding">
                        <table>
                            <tr>
                                <td>
                                    <?php //include_partial('general/applicationMessageControl') ?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <img src="/images/mails.png" width="35" height="35" alt="mails"/>
                                </td>
                                <td>
                                    <h3>Send Messages to any connections or emails</h3>
                                </td>
                            </tr>
                        </table>
                        
                        <form id="frmSendMessage" name="Add title" action="<?php //echo url_for('home/sendMessage') ?>" method="get">
                            <table>
                                <?php //echo $form; ?>
                                <tr>
                                    <td colspan="2">
                                        <input type="submit" value="Send" style="width: 50px"/>
                                    </td>
                                </tr>
                            </table>
                            <input onclick="LoadUserConnectionList();" type="text" name="To" id="txtMailTo" class="ui-autocomplete-input required" title="Search Connection" size="100%" />
                            <input type="text" name="Subject" title="Subject" size="100%" />
                            <textarea name="Message" rows="4" cols="10" style="width: 50%"></textarea>
                            <input type="submit" value="Send" style="width: 50px"/>
                                <button id="btnSend"> Send </button>
                                <button> Save as Draft</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>-->
